import './assets/base.scss'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

//图标 图标在附件中
import '@/assets/icon/iconfont.css'
import './assets/base.scss'
import store from './store'

//引入cookies
import VueCookies from'vue-cookies'
//引入element-plus
import ElementPlus from'element-plus'
import 'element-plus/dist/index.css'
import * as echarts from 'echarts'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//全局方法
import Verify from './utils/Verify'
import Message from './utils/Message'
import Request from './utils/Request'
import Confirm from './utils/confirm'

//全局组件
import Dialog from './components/Dialog.vue'
import Avatar from './components/Avatar.vue'
import TagsItem4List from './components/TagsItem4List.vue'
import Image from './components/Image.vue'
import DataList from './components/DataList.vue'
import NoData from './components/NoData.vue'
import Table from './components/Table.vue'
import HalfTable from "@/components/halfTable.vue";
import AdminDialog from './components/adminDialog.vue'
import Window from './components/Window.vue'
import Editor from './components/Editor.vue'
import AvatarUpload from './components/AvatarUpload.vue'

import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
import plugins from './plugins' // plugins
const app = createApp(App)
app.use(plugins)
app.use(router)
app.use(store)
app.use(ElementPlus);
app.config.globalProperties.VueCookies=VueCookies;
app.config.globalProperties.globalInfo={
    bodyWidth:1500,//导航栏的长度
    avatarUrl: "/api/file/getAvatar/",//改头像接口
    imageUrl:"" ,//封面接口

}
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
app.config.globalProperties.Verify=Verify
app.config.globalProperties.Message=Message
app.config.globalProperties.Request=Request
app.config.globalProperties.Confirm=Confirm
app.config.globalProperties.$echarts=echarts
// echarts.use([CanvasRenderer]);

app.config.globalProperties.parseTime = parseTime
app.config.globalProperties.resetForm = resetForm
app.config.globalProperties.handleTree = handleTree
app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.selectDictLabels = selectDictLabels
app.component("Dialog",Dialog)
app.component("Avatar",Avatar)
app.component("TagsItem4List",TagsItem4List)
app.component("Image",Image)
app.component("DataList",DataList)
app.component("NoData",NoData)
app.component("Table",Table);
app.component("HalfTable",HalfTable);
app.component("AdminDialog",AdminDialog);
app.component("Window",Window);
app.component('Editor',Editor);
app.component('AvatarUpload',AvatarUpload);
app.mount('#app')
